package com.yxw.springmvc.userBehavior.controller;

import com.yxw.springmvc.userBehavior.service.RandomCodeService;
import com.yxw.springmvc.userBehavior.util.RandomCodeUtils;
import com.yxw.springmvc.userBehavior.model.RandomCode;
import com.yxw.springmvc.userBehavior.util.SequenceUtil;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 随机数控制器
 * Author: Terence
 * Date:   2014/10/13
 * Time:   14:14
 */
@Controller
@RequestMapping("/randomCode")
public class RandomCodeController {
    private Logger logger = Logger.getLogger(UserController.class);

    @Resource
    private RandomCodeService randomCodeService;

    @RequestMapping("/generate")
    @ResponseBody
    public RandomCode generate(){
        RandomCode randomCode = randomCodeService.generate();
        return randomCode;
    }

}
